AMF project configuration
To run AMF in your application, you'll need add AMF to your dependencies and then add the AMF intialiization method to your application code.
Download AMF artifacts
You can download the necessary AMF artifacts from:
Add AMF to your dependencies
The following example shows how to add AMF to your project using Gradle, Maven, or NPM.
- Gradle
- Maven
- NPM
// add mulesoft repository
repositories {
maven {
url 'https://repository-master.mulesoft.org/nexus/content/repositories/releases'
}
}
dependencies {
compile 'com.github.amlorg:amf-client_2.12:x.y.z'
}
<dependency>
<groupId>com.github.amlorg</groupId>
<artifactId>amf-client_2.12</artifactId>
<version>x.y.z</version>
</dependency>
NPM or Yarn:
$ npm install --save amf-client-js #using npm
$ yarn add --save amf-client-js #using yarn
NOTE: you may use the -SNAPSHOT
versions of the artifacts at your own risk since those snapshot versions may contain breaking changes.
Add the AMF initialization method to your application code
The following example shows how to add the AMF initialization method (AMF.init()
) in your application code:
- Java
- JavaScript
import amf.client.AMF;
class App {
public static void main(String[] args){
AMF.init().thenApply(() -> {
// ... your code
});
}
}
const amf = require('./lib/amf-client-module.js')
await AMF.init();
// ... your code
Learn more about using the AMF initialization method, AMF.init()
.